package zhishuang.wang.sansi.tools;

/**
 * @Author Zhishuang.Wang
 * @Date 2023/7/5 11:15
 * @Email 1406110602@qq.com
 */
public class ToolClass {
    public ToolClass() {
    }

    public static boolean ipCheck(String ipAddr) {
        if (ipAddr != null && !ipAddr.isEmpty()) {
            String regex = "^(1\\d{2}|2[0-4]\\d|25[0-5]|[1-9]\\d|[1-9])\\.(1\\d{2}|2[0-4]\\d|25[0-5]|[1-9]\\d|\\d)\\.(1\\d{2}|2[0-4]\\d|25[0-5]|[1-9]\\d|\\d)\\.(1\\d{2}|2[0-4]\\d|25[0-5]|[1-9]\\d|\\d)$";
            return ipAddr.matches(regex);
        } else {
            return false;
        }
    }
}
